// 自动生成模板SysPrescriptionRecord
package system

import (
	"github.com/flipped-aurora/gin-vue-admin/server/global"
	"gorm.io/datatypes"
)

// 药方 结构体  SysPrescriptionRecord
type SysPrescriptionRecord struct {
	global.GVA_MODEL
	UserId           int64          `json:"user_id" form:"user_id" gorm:"comment:用户id;column:user_id;"`                                                                       //用户
	PrescriptionName *string        `json:"prescription_name" form:"prescription_name" gorm:"comment:药方名称;column:prescription_name;" binding:"required"`                      //名称
	PrescriptionData datatypes.JSON `json:"prescription_data" form:"prescription_data" gorm:"comment:药方药品;column:prescription_data;" swaggertype:"object" binding:"required"` //药品
	Price            *float64       `json:"price" form:"price" gorm:"comment:药方价格;column:price;" binding:"required"`                                                          //价格
	PatientData      datatypes.JSON `json:"patient_data" form:"patient_data" gorm:"comment:患者信息;column:patient_data;" swaggertype:"object" binding:"required"`                //患者信息
	PatientId        *int64         `json:"patient_id" form:"patient_id" gorm:"comment:患者id;column:patient_id;" binding:"required"`                                           //患者id
	Ji               *int           `json:"ji" form:"ji" gorm:"comment:剂数量;column:ji;" binding:"required"`                                                                    //剂数量
	TotalPrice       *float64       `json:"total_price" form:"total_price" gorm:"comment:总价;column:total_price;" binding:"required"`                                          //总价
	Status           *string        `json:"status" form:"status" gorm:"comment:处方状态;column:status;default:pending"`                                                           //处方状态：pending-待核准，approved-已核准
}

// TableName 药方 SysPrescriptionRecord自定义表名 sys_prescription_record
func (SysPrescriptionRecord) TableName() string {
	return "sys_prescription_record"
}
